package com.example.phpclient.DB;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class NotesDB extends SQLiteOpenHelper {
    public static final String TABLE_NAME ="notes";
    public static final String CONTENT ="content";
    public static final String PATH ="path";//图片
    public static final String VIDEO ="video";
    public static final String ID ="_id";
    public static final String TIME ="time";
    public static final String MAN_NO ="man_no";//管理员编号
    public static final String MAN_CLASS ="man_class";//教室

    public NotesDB(@Nullable Context context) {
        super(context, "notes", null, 3);
    }


    @Override
    //创建数据库
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL("CREATE TABLE "+ TABLE_NAME+ " ("
        + ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
        + CONTENT  +" TEXT NOT NULL ,"
        + PATH + " TEXT NOT NULL, "
        + VIDEO + " TEXT NOT NULL,"
        +TIME + " TEXT NOT NULL,"
        + MAN_CLASS +" TEXT NOT NULL,"
        + MAN_NO + " TEXT NOT NULL)");

    }

    @Override
    //更新数据库
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
